//鼠标滑过，改变图片
window.onload=function(){
	var img1 = document.getElementById('img1');
	img1.onmouseover = function() {
		img1.src = 'Login/btn_login_p.png';;
		img1.onmouseout = function() {
			img1.src = 'Login/btn_login_n.png';
		};
	};
	var img2 = document.getElementById('img2');
	img2.onmouseover = function() {
		img2.src = 'Login/btn_logout_p.png';;
		img2.onmouseout = function() {
			img2.src = 'Login/btn_logout_n.png';
		};
	};
} 

// function login() {
// 	location.href = "index.html";
// }

function login() {
	var username = document.getElementById("user").value;
	var password = document.getElementById("paw").value;
	if(username.length === 0){
		alert("请输入账号！");
	}else if(password.length === 0){
		alert("请输入密码！");
	}else if(username == "111" && password == "123456") {
		alert("登录成功");
		window.location.href = "index.html";
		return false;
	} else {
		alert("账号或密码错误");
		window.location.href = "login.html";
		return false;
	}
}
